<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>1 flex 和 inline-flex区别</title>
  <style>
    .box1 {
      background: #000;
      display: flex;
      /* 看这里 */
    }

    .box1 div {
      width: 80px;
      padding: 5px;
      border: solid 1px #fff;
      color: #fff;
    }

    .box2 {
      background: #000;
      display: inline-flex;
      /* 看这里 */
    }

    .box2 div {
      width: 80px;
      padding: 5px;
      border: solid 1px #fff;
      color: #fff;
    }
  </style>
</head>

<body>
  <div class="box1">
    <div>box1-01</div>
    <div>box1-02</div>
    <div>box1-03</div>
    <div>box1-04</div>
  </div>

  <div class="box2">
    <div>box2-01</div>
    <div>box2-02</div>
    <div>box2-03</div>
    <div>box2-04</div>
  </div>
</body>

</html>